package cn.silver.module.system.enums;

import cn.silver.framework.core.model.DictModel;
import cn.silver.framework.core.utils.StreamUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum RoleScopeEnums {
    ALL_SCOPE("00", "全部数据权限"),
    TENANT_SCOPE("01", "租户数据权限"),
    DEPT_SCOPE("02", "本部门数据权限"),
    DEPT_ALL_SCOPE("03", "本部门及以下数据权限"),
    CURRENT_SCOPE("90", "仅本人数据权限"),
    OTHER_SCOPE("99", "自定义数据权限"),
    ;
    private final String code;
    private final String name;

    public static List<DictModel> getModels() {
        return StreamUtils.toList(Arrays.asList(values()), item -> new DictModel(item.name, item.code));
    }
}
